#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define fast ios::sync_with_stdio(0)
const int MX=100100;
int n,ans;
string s;
int main()
{
   cin>>n;
   while(n--){
       cin>>s;
       int a=0,b=0;
       for(char i:s){
           if(i=='i'||i=='e'||i=='u'||i=='o'||i=='a')
               a++;
           else b++;
       }
       cout<<s<<"\n";
       if(a>b) cout<<"1\n";
       else cout<<"0\n";
   }
    return 0;
}
